﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using XWord.Fundamental.Domain;
using Microsoft.Practices.ServiceLocation;
using Caliburn.PresentationFramework.ApplicationModel;
using XWord.Fundamental.Domain.Model;
using Caliburn.Core.Metadata;
using XWord.WPF.ApplicationFramework;
using XWord.Common;
namespace XWord.GUI.Presenters
{
    [Singleton(typeof(RCArticlePresenter))]
    public class RCArticlePresenter : Presenter
    {
        public RCArticlePresenter()
        {
            RCArticleList = BinaryFormatterHelper.Deserialize<IList<RCArticle>>(BinaryFiles.RCArticleList);
        }

        public IList<RCArticle> RCArticleList { get; set; }

        public void OpenArticleDetailViewDialog(RCArticle entity)
        {
            var presenter = ServiceLocator.Current.GetInstance<RCArticleDetailPresenter>();
            presenter.Detail = entity;
           // this.Parent = presenter;
            ServiceLocator.Current.GetInstance<IWindowManager>()
                .Show(presenter, null, ExecuteShutdownModel);
        }

    }
}
